//
//  PaperViewBuild.m
//  ZYOnlineSchool
//
//  Created by 毕武侠 on 2017/3/10.
//  Copyright © 2017年 bwx. All rights reserved.
//

#import "PaperViewBuild.h"
#import "PaperAnswerView.h"
#import "PaperAnalyView.h"
#import "PaperTestView.h"

@implementation PaperViewBuild

+ (PaperBaseView *)createPaperViewWithIdentifier:(NSString *)identifier {
    PaperBaseView *view;
    if ([identifier isEqualToString:@"PaperAnswerID"]) {
        view = [self createAnswerView];
    } else if ([identifier isEqualToString:@"PaperAnalyID"]) {
        view = [self createAnalyView];
    } else if ([identifier isEqualToString:@"PaperTestID"]) {
        view = [self createTestView];
    }
    
    return view;
}

// 创建答题页
+ (PaperAnswerView *)createAnswerView {
    PaperAnswerView *view = [[PaperAnswerView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - 64 - 40)];
    return view;
}

// 创建解析页
+ (PaperAnalyView *)createAnalyView {
    PaperAnalyView *view = [[PaperAnalyView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - 64 - 40)];
    return view;
}

// 创建自测页
+ (PaperAnalyView *)createTestView {
    PaperTestView *view = [[PaperTestView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - 64 - 40)];
    return (PaperAnalyView *)view;
}

@end
